var removeNthFromEnd = function(head, n) {
    // 创造一个虚拟结点
    let ret=new ListNode(0,head)
    let slow=fast=ret
    while(n--){
        fast=fast.next
    }
    while(fast.next){//预防fast不指向null
        slow=slow.next
        fast=fast.next
    }
    slow.next=slow.next.next
    return ret.next


}